package bancosys.tec.services.testcase;

import org.springframework.transaction.TransactionStatus;

/**
 * Testcase que sube a base de referência. Uma por VM!
 * 
 * @author wagner
 */
public abstract class DefaultRefDBTestCase extends RefDBTestCase {
    private TransactionStatus txStatus = null;

    /**
     * Construtor.
     */
    public DefaultRefDBTestCase() {
        super();
    }

    /**
     * Construtor.
     * 
     * @param name nome
     */
    public DefaultRefDBTestCase(String name) {
        super(name);
    }

    @Override
    public void setUp() throws Exception {
        super.setUp();
        if (this.txStatus == null) {
            this.txStatus = this.getHelper().getTransactionStatus();
        }
    }

    @Override
    public void tearDown() throws Exception {
        if (this.txStatus != null) {
            this.getHelper().rollback(this.txStatus);
        }
        super.tearDown();
    }
}
